/*   1:    */ package org.intellij.plugins.relaxNG.compact.psi.impl;
/*   2:    */ 
/*   3:    */

import com.intellij.extapi.psi.PsiFileBase;
import com.intellij.lang.ASTNode;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.psi.FileViewProvider;
import com.intellij.psi.PsiElement;
import com.intellij.psi.ResolveState;
import com.intellij.psi.scope.PsiScopeProcessor;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.ProjectScope;
import com.intellij.psi.search.PsiElementProcessor;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.psi.xml.XmlDocument;
import com.intellij.psi.xml.XmlFile;
import com.intellij.psi.xml.XmlTag;
import com.intellij.util.IncorrectOperationException;
import org.intellij.plugins.relaxNG.compact.RncElementTypes;
import org.intellij.plugins.relaxNG.compact.RncFileType;
import org.intellij.plugins.relaxNG.compact.RngCompactLanguage;
import org.intellij.plugins.relaxNG.compact.psi.RncDecl;
import org.intellij.plugins.relaxNG.compact.psi.RncFile;
import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;
import org.jetbrains.annotations.NotNull;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */
/*  16:    */
/*  17:    */
/*  18:    */
/*  19:    */
/*  20:    */
/*  21:    */
/*  22:    */
/*  23:    */
/*  24:    */
/*  25:    */
/*  26:    */ 
/*  27:    */ public class RncFileImpl
/*  28:    */   extends PsiFileBase
/*  29:    */   implements RncFile, XmlFile
/*  30:    */ {
/*  31: 48 */   private static final TokenSet m = TokenSet.create(new IElementType[] { RncElementTypes.NS_DECL, RncElementTypes.DATATYPES_DECL });
/*  32:    */   
/*  33:    */   public RncFileImpl(FileViewProvider paramFileViewProvider)
/*  34:    */   {
/*  35: 51 */     super(paramFileViewProvider, RngCompactLanguage.INSTANCE);
/*  36:    */   }
/*  37:    */   
/*  38:    */   @NotNull
/*  39:    */   public FileType getFileType()
/*  40:    */   {
/*  41: 56 */     FileType tmp3_0 = RncFileType.getInstance();
/*  42: 56 */     if (tmp3_0 == null) {
/*  43: 56 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl", "getFileType" }));
/*  44:    */     }
/*  45: 56 */     return tmp3_0;
/*  46:    */   }
/*  47:    */   
/*  48:    */   @NotNull
/*  49:    */   public XmlDocument getDocument()
/*  50:    */   {
/*  51: 62 */     XmlDocument localXmlDocument = (XmlDocument)findChildByClass(XmlDocument.class);
/*  52: 63 */     assert (localXmlDocument != null); XmlDocument 
/*  53: 64 */       tmp29_28 = localXmlDocument;
/*  54: 64 */     if (tmp29_28 == null) {
/*  55: 64 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl", "getDocument" }));
/*  56:    */     }
/*  57: 64 */     return tmp29_28;
/*  58:    */   }
/*  59:    */   
/*  60:    */   public XmlTag getRootTag()
/*  61:    */   {
/*  62: 69 */     return getDocument().getRootTag();
/*  63:    */   }
/*  64:    */   
/*  65:    */   public boolean processDeclarations(@NotNull PsiScopeProcessor paramPsiScopeProcessor, @NotNull ResolveState paramResolveState, PsiElement paramPsiElement1, @NotNull PsiElement paramPsiElement2)
/*  66:    */   {
/*  67: 76 */     if (paramPsiScopeProcessor == null) {
/*  68: 76 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl", "processDeclarations" }));
/*  69:    */     }
/*  70: 76 */     if (paramResolveState == null) {
/*  71: 76 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl", "processDeclarations" }));
/*  72:    */     }
/*  73: 76 */     if (paramPsiElement2 == null) {
/*  74: 76 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "3", "org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl", "processDeclarations" }));
/*  75:    */     }
/*  76:    */     try
/*  77:    */     {
/*  78: 76 */       ASTNode localASTNode = getDocument().getNode();
/*  79: 77 */       assert (localASTNode != null);
/*  80: 78 */       ASTNode[] arrayOfASTNode = localASTNode.getChildren(m);
/*  81: 79 */       for (Object localObject2 : arrayOfASTNode) {
/*  82: 80 */         if (!paramPsiScopeProcessor.execute(localObject2.getPsi(), paramResolveState))
/*  83:    */         {
/*  84: 81 */           boolean bool2 = false;return bool2;
/*  85:    */         }
/*  86:    */       }
/*  87: 85 */       ??? = getGrammar();
/*  88: 86 */       if (??? != null)
/*  89:    */       {
/*  90: 87 */         bool1 = ((RncGrammar)???).processDeclarations(paramPsiScopeProcessor, paramResolveState, paramPsiElement1, paramPsiElement2);return bool1;
/*  91:    */       }
/*  92: 89 */       boolean bool1 = true;return bool1;
/*  93:    */     }
/*  94:    */     finally {}
/*  95:    */   }
/*  96:    */   
/*  97:    */   public PsiElement add(@NotNull PsiElement paramPsiElement)
/*  98:    */     throws IncorrectOperationException
/*  99:    */   {
/* 100: 98 */     if (paramPsiElement == null) {
/* 101: 98 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl", "add" }));
/* 102:    */     }
/* 103: 98 */     return getDocument().add(paramPsiElement);
/* 104:    */   }
/* 105:    */   
/* 106:    */   public PsiElement addAfter(@NotNull PsiElement paramPsiElement1, PsiElement paramPsiElement2)
/* 107:    */     throws IncorrectOperationException
/* 108:    */   {
/* 109:103 */     if (paramPsiElement1 == null) {
/* 110:103 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl", "addAfter" }));
/* 111:    */     }
/* 112:103 */     return getDocument().addAfter(paramPsiElement1, paramPsiElement2);
/* 113:    */   }
/* 114:    */   
/* 115:    */   public PsiElement addBefore(@NotNull PsiElement paramPsiElement1, PsiElement paramPsiElement2)
/* 116:    */     throws IncorrectOperationException
/* 117:    */   {
/* 118:108 */     if (paramPsiElement1 == null) {
/* 119:108 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/intellij/plugins/relaxNG/compact/psi/impl/RncFileImpl", "addBefore" }));
/* 120:    */     }
/* 121:108 */     return getDocument().addBefore(paramPsiElement1, paramPsiElement2);
/* 122:    */   }
/* 123:    */   
/* 124:    */   public boolean processElements(PsiElementProcessor paramPsiElementProcessor, PsiElement paramPsiElement)
/* 125:    */   {
/* 126:112 */     return false;
/* 127:    */   }
/* 128:    */   
/* 129:    */   public GlobalSearchScope getFileResolveScope()
/* 130:    */   {
/* 131:116 */     return ProjectScope.getAllScope(getProject());
/* 132:    */   }
/* 133:    */   
/* 134:    */   public boolean ignoreReferencedElementAccessibility()
/* 135:    */   {
/* 136:121 */     return false;
/* 137:    */   }
/* 138:    */   
/* 139:    */   public String toString()
/* 140:    */   {
/* 141:126 */     return getClass().getSimpleName() + ":" + getName();
/* 142:    */   }
/* 143:    */   
/* 144:    */   public RncDecl[] getDeclarations()
/* 145:    */   {
/* 146:130 */     return (RncDecl[])((RncDocument)getDocument()).findChildrenByClass(RncDecl.class);
/* 147:    */   }
/* 148:    */   
/* 149:    */   public RncGrammar getGrammar()
/* 150:    */   {
/* 151:134 */     XmlDocument localXmlDocument = getDocument();
/* 152:135 */     return ((RncDocument)localXmlDocument).getGrammar();
/* 153:    */   }
/* 154:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.plugins.relaxNG.compact.psi.impl.RncFileImpl

 * JD-Core Version:    0.7.0.1

 */